<template>
  <div class="app-box">
    <!-- 头部-->
    <div class="header-box">
<!--      <div class="left-box">-->
<!--        <img src="@/assets/left.png" alt="" srcset="">-->
<!--      </div>-->
      <div class="h-box">试卷答题</div>
    </div>

    <el-row class="app-item-contain">
      <!--试卷列表-->
      <div class="test-paper">
        <div class="test-paper-item" v-for="item in paperList" :key="item.id">
          <!--左-->
          <div>
            <div>{{ item.paperTitle }}</div>
            <div class="test-des">
              <span>题目数量：{{ item.questionCount }}</span>
              <span>试卷总分：{{ item.scoreStr }}</span>
            </div>
            <div class="test-des">
              <span>题目数量：{{ item.questionCount }}</span>
              <span>试卷总分：{{ item.scoreStr }}</span>
            </div>
          </div>
          <!--右-->
          <div style="display: flex;justify-content: right">
            <div style="padding: 2px 5px;background-color: #45c4dd ;color: white;font-size: 12px">查看试卷</div>
          </div>
        </div>

      </div>
    </el-row>
  </div>
</template>
<script>
import  {getPaper} from '@/api/index'
export default {
  name: "indexPage",
  data() {
    return {
      subjectList: [
        {
          "id": 139,
          "name": "98",
          "limitStartTime": null,
          "limitEndTime": null,
          "paperType": 1,
          "score": 150,
          "questionCount": 3,
          "suggestTime": 4,
          "subjectId": 4,
          "startTime": "",
          "endTime": "",
          "paperTypeStr": "固定试卷",
          "scoreStr": "15",
          "suggestTimeStr": "4分钟",
          "subjectName": "语文"
        },
        {
          "id": 131,
          "name": "野外生存训练考核A",
          "limitStartTime": null,
          "limitEndTime": null,
          "paperType": 1,
          "score": 10,
          "questionCount": 1,
          "suggestTime": 100,
          "subjectId": 4,
          "startTime": "",
          "endTime": "",
          "paperTypeStr": "固定试卷",
          "scoreStr": "1",
          "suggestTimeStr": "1小时40分钟",
          "subjectName": "语文"
        },
        {
          "id": 127,
          "name": "测试",
          "limitStartTime": 1736956800000,
          "limitEndTime": 1739635200000,
          "paperType": 4,
          "score": 50,
          "questionCount": 2,
          "suggestTime": 90,
          "subjectId": 4,
          "startTime": "2025-01-16 00:00:00",
          "endTime": "2025-02-16 00:00:00",
          "paperTypeStr": "时段试卷",
          "scoreStr": "5",
          "suggestTimeStr": "1小时30分钟",
          "subjectName": "语文"
        },
        {
          "id": 124,
          "name": "啊啊",
          "limitStartTime": null,
          "limitEndTime": null,
          "paperType": 1,
          "score": 100,
          "questionCount": 1,
          "suggestTime": 33,
          "subjectId": 5,
          "startTime": "",
          "endTime": "",
          "paperTypeStr": "固定试卷",
          "scoreStr": "10",
          "suggestTimeStr": "33分钟",
          "subjectName": "数学"
        },
        {
          "id": 116,
          "name": "212",
          "limitStartTime": null,
          "limitEndTime": null,
          "paperType": 1,
          "score": 100,
          "questionCount": 5,
          "suggestTime": 5,
          "subjectId": 4,
          "startTime": "",
          "endTime": "",
          "paperTypeStr": "固定试卷",
          "scoreStr": "10",
          "suggestTimeStr": "5分钟",
          "subjectName": "语文"
        },
        {
          "id": 222,
          "name": "啊啊",
          "limitStartTime": null,
          "limitEndTime": null,
          "paperType": 1,
          "score": 100,
          "questionCount": 1,
          "suggestTime": 33,
          "subjectId": 5,
          "startTime": "",
          "endTime": "",
          "paperTypeStr": "固定试卷",
          "scoreStr": "10",
          "suggestTimeStr": "33分钟",
          "subjectName": "数学"
        }, {
          "id": 1222,
          "name": "啊啊",
          "limitStartTime": null,
          "limitEndTime": null,
          "paperType": 1,
          "score": 100,
          "questionCount": 1,
          "suggestTime": 33,
          "subjectId": 5,
          "startTime": "",
          "endTime": "",
          "paperTypeStr": "固定试卷",
          "scoreStr": "10",
          "suggestTimeStr": "33分钟",
          "subjectName": "数学"
        },
      ],
      paperList:[],
      queryParams:{
        pageNum:1,
        pageSize:10,
      }
    }
  },
  created() {
    this.getList(this.queryParams)
  },
  methods:{
    getList(data){
      getPaper(data).then(res=>{
        console.log(res)
        this.paperList = res.rows
      })
    },
    goDo(id){
      this.$router.push({
        path:'/do',
        query:{
          id:id
        }
      })
    }
  }
}
</script>
<style scoped lang="scss">
.app-box {
  background-color: rgb(239, 243, 247)
}

.text {
  font-size: 14px;
}

.item {
  padding: 18px 0;
}

.box-card {
  width: 480px;
}

.app-item-contain {
  background-color: white;
}

.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
  background-color: #d3dce6;
}

.index-title-h3 {
  font-size: 16px;
  font-weight: 400;
  color: #1f2f3d;
  border-left: solid 10px #2ce8b4;
  padding-left: 10px;
}

.el-carousel__item h3 {
  color: #475669;
  font-size: 18px;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
  background-color: #d3dce6;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  padding: 0;
  float: right;
}

.image {
  width: 50%;
  height: 80%;
  display: block;
  margin: 20px auto 10px auto;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both
}

.carousel-img {
  display: inline-block;
  height: 300px;
  width: 100%;
}
.test-paper{
  margin-bottom: 50px;
}
.test-paper-item {
  border-top: 1px solid #999999;
  background: #fff;
  padding: 10px;
  margin-bottom: 1px;
  font-size: 14px;
  flex-direction: row;
  align-items: center;

  div {
    line-height: 1.8;
  }
}

.test-des {
  color: #909399;
  font-size: 13px;
}

.test-time {
  padding: 0 2px;
  color: #f37b1d;
  background-color: #eff3f7;
  font-size: 14px;
  display: flex;
  justify-content: center;
  border-radius: 10px;
  word-wrap: break-word;
  word-break: break-all;
  align-items: center;
}
.header-box {
  display: flex;
  padding: 5px 10px;
}

.h-box {
  width: 100%;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-top: 0;
}
</style>
